﻿using System;

namespace Close2Poco
{
    /// <summary>
    /// Lets you specify a type mapping different from the default.  See http://msdn2.microsoft.com/en-us/bb386947.aspx 
    /// Cannot be combined with <see cref="LengthAttribute"/>
    /// </summary>
    public class DbTypeAttribute: MappingAttribute
    {
        public DbTypeAttribute(string databaseType)
        {
            DatabaseType = databaseType;
        }

        public readonly string DatabaseType;

        internal override string GetMappingText()
        {
            return "DbType=\"" + DatabaseType + "\"";
        }
    }
}